home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 5.4 KB | 199 lines | [TEXT/MPS ] |
- ;
- ; File: AppleScript.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN
- __APPLESCRIPT__ SET 1
-
-
- IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
- include 'Errors.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
- include 'AppleEvents.a'
- ENDIF
- ; include 'Types.a' ;
- ; include 'Memory.a' ;
- ; include 'MixedMode.a' ;
- ; include 'OSUtils.a' ;
- ; include 'Events.a' ;
- ; include 'Quickdraw.a' ;
- ; include 'QuickdrawText.a' ;
- ; include 'EPPC.a' ;
- ; include 'PPCToolbox.a' ;
- ; include 'AppleTalk.a' ;
- ; include 'Processes.a' ;
- ; include 'Files.a' ;
- ; include 'Notification.a' ;
-
- IF &TYPE('__OSA__') = 'UNDEFINED' THEN
- include 'OSA.a'
- ENDIF
- ; include 'AEObjects.a' ;
- ; include 'Components.a' ;
-
- IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
- include 'TextEdit.a'
- ENDIF
-
- typeAppleScript EQU 'ascr'
- kAppleScriptSubtype EQU typeAppleScript
- typeASStorage EQU typeAppleScript
-
- ;*************************************************************************
- ; Component Selectors
- ;*************************************************************************
- kASSelectInit EQU $1001
- kASSelectSetSourceStyles EQU $1002
- kASSelectGetSourceStyles EQU $1003
- kASSelectGetSourceStyleNames EQU $1004
-
- ;*************************************************************************
- ; OSAGetScriptInfo Selectors
- ;*************************************************************************
- kASHasOpenHandler EQU 'hsod'
-
- ;
- ; This selector is used to query a context as to whether it contains
- ; a handler for the kAEOpenDocuments event. This allows "applets" to be
- ; distinguished from "droplets." OSAGetScriptInfo returns false if
- ; there is no kAEOpenDocuments handler, and returns the error value
- ; errOSAInvalidAccess if the input is not a context.
- ;
- ;*************************************************************************
- ; Initialization
- ;*************************************************************************
- IF GENERATING68K THEN
- Macro
- _ASInit
- dc.w $2F3C
- dc.w $001C
- dc.w $1001
- moveq #0,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT ASInit
- ENDIF
-
- ;
- ; ComponentCallNow(kASSelectInit, 28);
- ; This call can be used to explicitly initialize AppleScript. If it is
- ; not called, the a scripting size resource is looked for and used. If
- ; there is no scripting size resource, then the constants listed below
- ; are used. If at any stage (the init call, the size resource, the
- ; defaults) any of these parameters are zero, then parameters from the
- ; next stage are used. ModeFlags are not currently used.
- ; Errors:
- ; errOSASystemError initialization failed
- ;
- ;
- ; These values will be used if ASInit is not called explicitly, or if any
- ; of ASInit's parameters are zero:
- ;
- kASDefaultMinStackSize EQU 4 * 1024
- kASDefaultPreferredStackSize EQU 16 * 1024
- kASDefaultMaxStackSize EQU 16 * 1024
- kASDefaultMinHeapSize EQU 4 * 1024
- kASDefaultPreferredHeapSize EQU 16 * 1024
- kASDefaultMaxHeapSize EQU 32 * 1024 * 1024
-
- ;*************************************************************************
- ; Source Styles
- ;*************************************************************************
- IF GENERATING68K THEN
- Macro
- _ASSetSourceStyles
- dc.w $2F3C
- dc.w $0004
- dc.w $1002
- moveq #0,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT ASSetSourceStyles
- ENDIF
-
- ;
- ; ComponentCallNow(kASSelectSetSourceStyles, 4);
- ; Errors:
- ; errOSASystemError operation failed
- ;
- IF GENERATING68K THEN
- Macro
- _ASGetSourceStyles
- dc.w $2F3C
- dc.w $0004
- dc.w $1003
- moveq #0,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT ASGetSourceStyles
- ENDIF
-
- ;
- ; ComponentCallNow(kASSelectGetSourceStyles, 4);
- ; Errors:
- ; errOSASystemError operation failed
- ;
- IF GENERATING68K THEN
- Macro
- _ASGetSourceStyleNames
- dc.w $2F3C
- dc.w $0008
- dc.w $1004
- moveq #0,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT ASGetSourceStyleNames
- ENDIF
-
- ;
- ; ComponentCallNow(kASSelectGetSourceStyleNames, 8);
- ; This call returns an AEList of styled text descriptors the names of the
- ; source styles in the current dialect. The order of the names corresponds
- ; to the order of the source style constants, below. The style of each
- ; name is the same as the styles returned by ASGetSourceStyles.
- ;
- ; Errors:
- ; errOSASystemError operation failed
- ;
- ;
- ; Elements of STHandle correspond to following categories of tokens, and
- ; accessed through following index constants:
- ;
- kASSourceStyleUncompiledText EQU 0
- kASSourceStyleNormalText EQU 1
- kASSourceStyleLanguageKeyword EQU 2
- kASSourceStyleApplicationKeyword EQU 3
- kASSourceStyleComment EQU 4
- kASSourceStyleLiteral EQU 5
- kASSourceStyleUserSymbol EQU 6
- kASSourceStyleObjectSpecifier EQU 7
- kASNumberOfSourceStyles EQU 8
-
- ; Gestalt selectors for AppleScript
- gestaltAppleScriptAttr EQU 'ascr'
- gestaltAppleScriptVersion EQU 'ascv'
-
- gestaltAppleScriptPresent EQU 0
- gestaltAppleScriptPowerPCSupport EQU 1
-
- ENDIF ; __APPLESCRIPT__
-